﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using childApp.common;

namespace childApp.member
{
    public partial class MemAddForm : Form
    {
        public MemAddForm()
        {
            InitializeComponent();
        }

        private Boolean addMem()
        {

            string sex = this.cmbSex.Text;
            string name = this.txtName.Text;
            string addr = this.txtAddr.Text;
            string score = this.txtScore.Text;
            string birth = this.dtpBirth.Text;

            StringBuilder sb = new StringBuilder("insert into(name,sex,addr,score,birth) values(''" + name + "'," + sex + "','" + addr + "', '" + score + "', '" + birth + "')");
            return DbCommon.Getsqlcom(sb.ToString());

        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (addMem())
            {
                MessageBox.Show("数据插入成功！");
                this.Close();
                this.Dispose();
            }

        }

        private void btmCancle_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
        }
    }
}
